{% load i18n %}
{% load promgen %}

{% if service.rule_set.count or request.site.rule_set.count %}
<div class="panel panel-default">
  <table class="table table-bordered table-condensed">
    {% include "promgen/rule_header.html" %}
    {% include "promgen/rule_block.html" with rule_list=service.rule_set.all toggle=1 delete=1 %}
    {% include "promgen/rule_block.html" with rule_list=request.site.rule_set.all collapse="service-site-rules-" overwrite_type='service' overwrite_id=service.id %}
  </table>
  <div class="panel-footer">
    <a class="btn btn-default btn-xs" role="button" data-toggle="collapse" href=".service-site-rules-{{service.id}}" aria-expanded="false" aria-controls="collapseExample">
      {% translate 'Show Site Rules' %}
    </a>
  </div>
</div>
{% endif %}
